package com.qingke.oo;

public class Object_Dog {
	private String name;
	private double price;
	
	public Object_Dog(String name,double price){
		this.name = name;
		this.price = price;
	}
	
	public boolean equals(Object o){
		if(o instanceof Object_Dog){
			Object_Dog d = (Object_Dog)o;
			if(this.name==d.name && this.price==d.price)
				return true;
			return false;
		}
		return false;
	}
	
	public static void main(String []args){
		Object_Dog d1 = new Object_Dog("Mike",1000);
		Object_Dog d2 = new Object_Dog("Mike",1000);
		System.out.println(d1.equals(d2));
	}
}
